How check data is empty or not in JavaScript